home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 2010 Software/Programs / PCGuia_programas.iso / Software / Toolkits / Escritorio / Open Contacts / setup.exe / {app} / DataSet / Templates / defaultCommunication.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2009-01-19  |  6.1 KB  |  170 lines

  1. ∩╗┐<?xml version="1.0" encoding="UTF-8"?>
  2. <!--Render fields for electronic communications-->
  3. <xsl:stylesheet version="1.0"
  4. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  5.   <xsl:output method="xml" omit-xml-declaration="yes" encoding="UTF-8" />
  6.  
  7.   <xsl:template match="/">
  8.     <html>
  9.       <head>
  10.         <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  11.       </head>
  12.  
  13.       <body>
  14.         <xsl:for-each select="OpenContacts/Contacts/Contact">
  15.  
  16.           <table border="0" width="100%" id="table2">
  17.             <tr>
  18.               <td width="80%">
  19.                 <font face="Times New Roman" size="3">
  20.                   <b>
  21.                     <xsl:value-of select="@Name"/>
  22.                   </b>
  23.                 </font>
  24.               </td>
  25.             </tr>
  26.           </table>
  27.  
  28.           <xsl:if test="count(Sections/Section/Fields/Field[contains(@Name, 'Email')]) > 0">
  29.             <div style="margin-left: 15px;">
  30.               <b>
  31.                 <font face="Times New Roman" size="2">
  32.                   Email
  33.                 </font>
  34.               </b>
  35.             </div>
  36.  
  37.             <table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0">
  38.               <xsl:for-each select="Sections/Section/Fields/Field[contains(@Name, 'Email')]">
  39.                     <tr>
  40.                       <td width="15"></td>
  41.                       <td width="80" bgcolor="#C3D9FF">
  42.                         <b>
  43.                           <font face="Times New Roman" size="2">
  44.                             <xsl:value-of select="../../@Name"/>
  45.                           </font>
  46.                         </b>
  47.                       </td>
  48.  
  49.                       <td bgcolor="#E0ECFF">
  50.                         <font size="3">
  51.                           <xsl:choose>
  52.                             <xsl:when test="contains(@Name, 'Primary')">
  53.                             <b>
  54.                               <a href="mailto:{@Value}">
  55.                                 <xsl:value-of select="@Value"/>
  56.                               </a>
  57.                             </b>                            
  58.                             </xsl:when>
  59.                             <xsl:otherwise>
  60.                             <a href="mailto:{@Value}">
  61.                               <xsl:value-of select="@Value"/>
  62.                             </a>
  63.                               
  64.                             </xsl:otherwise>
  65.                           </xsl:choose>
  66.  
  67.                         </font>
  68.                       </td>
  69.                     </tr>
  70.               </xsl:for-each>
  71.  
  72.             </table>
  73.           </xsl:if>
  74.  
  75.           <xsl:if test="count(Sections/Section/Fields/Field[contains('Mobile Phone Phone2 Phone3', @Name)]) > 0">
  76.             <div style="margin-left: 15px;">
  77.               <b>
  78.                 <font face="Times New Roman" size="2">
  79.                   Phone
  80.                 </font>
  81.               </b>
  82.             </div>
  83.  
  84.             <table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0">
  85.               <xsl:for-each select="Sections/Section/Fields/Field[contains('Mobile Phone Phone2 Phone3', @Name)]">
  86.  
  87.                     <tr>
  88.                       <td width="15"></td>
  89.                       <td width="80" bgcolor="#C3D9FF">
  90.                         <b>
  91.                           <font face="Times New Roman" size="2">
  92.                             <xsl:choose>
  93.                               <xsl:when test="contains('Mobile',@Name)">
  94.                                 Mobile
  95.                               </xsl:when>
  96.                               <xsl:otherwise>
  97.                                 <xsl:value-of select="../../@Name"/>
  98.                               </xsl:otherwise>
  99.                     
  100.                             </xsl:choose>
  101.                              </font>
  102.                         </b>
  103.                       </td>
  104.  
  105.                       <td bgcolor="#E0ECFF">
  106.                         <font size="3">
  107.  
  108.  
  109.                           <a href="tel:{@Value}">
  110.                             <xsl:value-of select="@Value"/>
  111.                           </a>
  112.  
  113.                         </font>
  114.                       </td>
  115.                     </tr>
  116.               </xsl:for-each>
  117.  
  118.             </table>
  119.           </xsl:if>
  120.  
  121.           <xsl:if test="count(Sections/Section/Fields/Field[contains('Skype,ICQ,Yahoo,MSN', @Name)]) > 0">
  122.             <div style="margin-left: 15px;">
  123.               <b>
  124.                 <font face="Times New Roman" size="2">
  125.                   IM
  126.                 </font>
  127.               </b>
  128.             </div>
  129.  
  130.             <table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0">
  131.               <xsl:for-each select="Sections/Section/Fields/Field[contains('Skype,ICQ,Yahoo,MSN', @Name)]">
  132.                 <tr>
  133.                   <td width="15"></td>
  134.                   <td width="80" bgcolor="#C3D9FF">
  135.                     <b>
  136.                       <font face="Times New Roman" size="2">
  137.                         <xsl:value-of select="@Name"/>
  138.                       </font>
  139.                     </b>
  140.                   </td>
  141.  
  142.                   <td bgcolor="#E0ECFF">
  143.                     <font size="3">
  144.                       <xsl:choose>
  145.                         <xsl:when test="contains(@Name,'Skype')">
  146.                           <a href="skype:{@Value}">
  147.                             <xsl:value-of select="@Value"/>
  148.                           </a>
  149.                         </xsl:when>
  150.                         <!--More URI schemes can be found at http://en.wikipedia.org/wiki/URI_scheme. Whether a scheme work depends on the settings of the borwser your are using.-->
  151.                         <xsl:otherwise>
  152.                           <xsl:value-of select="@Value"/>
  153.                         </xsl:otherwise>
  154.  
  155.                       </xsl:choose>
  156.                     </font>
  157.                   </td>
  158.                 </tr>
  159.               </xsl:for-each>
  160.  
  161.             </table>
  162.           </xsl:if>
  163.  
  164.         </xsl:for-each>
  165.  
  166.       </body>
  167.     </html>
  168.   </xsl:template>
  169.  
  170. </xsl:stylesheet>